package p.ithorns.framework.redis.stream;


import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Component;
import p.ithorns.framework.redis.stream.Person;
import p.ithorns.framework.redis.stream.RedisStreamListener;
import p.ithorns.framework.redis.stream.RedisStreamTemplate;

/**
 * @Author: liuhaitao
 * @Date: 2022/12/8 15:16
 * @Description:
 */
//@Component
public class PersonStreamMessageListener extends RedisStreamListener<Person> {

    private final static Logger log = LoggerFactory.getLogger(PersonStreamMessageListener.class);

    public PersonStreamMessageListener(RedisStreamTemplate<?> template) {
        super(template);
    }

    @Override
    public void onMessage(Person value) {
        log.info("子类处理值 ==> {}", value);
    }

    @Override
    public String getStream() {
        return "stream2";
    }

    @Override
    public String getGroup() {
        return "group1";
    }

    @Override
    public String getGroupName() {
        return "消费者组3";
    }

    public Class<Person> getRawType() {
        return Person.class;
    }

}